<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Head -->
<head>
    <meta charset="utf-8"/>
    <title>${session.SOFT_NAME}_智能办公系统</title>
    <meta name="description" content="Dashboard"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <head>
        <script type="text/javascript" src="/gobal/js/jquery/jquery-2.0.3.min.js"></script>
        <script src="/module/wps/wps_sdk.js"></script>
        <script src="/module/wps/env_check.js"></script>
        <script type="text/javascript">
            var openModeType = "${parameter.openModeType}";
            var serverUrl = "${mServerUrl}"; //服务器地址
            var fileUrl = serverUrl + "/sys/file/openFileOnLine?sessionId=${sessionId}&attachId=${parameter.attachId}&netDiskId=${parameter.netDiskId}&path=${parameter.path}";
            var uploadPath = serverUrl + "/office/wpsSave?sessionId=${sessionId}&attachId=${parameter.attachId}&fileId=${fileId}";
            var notifyUrl = serverUrl + "/office/wpsNotify?sessionId=${sessionId}&attachId=${parameter.attachId}&fileId=${fileId}&eventType={?}";
        </script>

    </head>
<body>
<div id="officediv" style="display: inline-block; float: left;"></div>
<form action="">
    <input type="hidden" name="attachId" id="attachId" value="${parameter.attachId}">
</form>
</body>
<script type="text/javascript">
    $(function () {
        setOfficeWH();
        initAddsOn(serverUrl, openDoc);
        setTimeout("window.close();", 2000);
    });
    window.onresize = function () {
        setOfficeWH();
    }

    function setOfficeWH() {
        $("#officediv").css("height", document.documentElement.clientHeight);
        $("#officediv").css("width", document.documentElement.clientWidth);
    }

    function openDoc() {
        var options = {
            "docId": "${parameter.attachId}", // 文档ID
            "uploadPath": uploadPath, // 保存文档上传路径
            "fileName": fileUrl
        };
        if (openModeType == 4 || openModeType == 5) {
            options.notifyUrl = notifyUrl;
        } else {
            //屏蔽功能按钮
            options.buttonGroups = 'WPSWorkExtTab';
        }
        _WppInvoke([{
            "OpenDoc": options
        }]);
    }
</script>
</html>
